﻿<%@ Page Language="C#" MasterPageFile="~/Frame.Master" AutoEventWireup="true" Codebehind="UserEditor.aspx.cs"
    Inherits="BaseSystem._System.UserEditor" Title="User Editor Page" %>

<%@ Register Assembly="Auto.Web.Common" Namespace="Auto.Web.Common" TagPrefix="cc1" %>
<%@ Import Namespace="Auto.Data.HumanResource" %>
<%@ Import Namespace="Auto.Data.Security" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentMain" runat="server">

    <script src="../_System/Script/Common.js" type="text/javascript"></script>

    <div>
        <div class="TitleDivStyle">
            <asp:Label ID="Label1" runat="server" Text="<%$ Resources:Base,UserEditor %>"></asp:Label></div>
        <table border="0" cellpadding="0" cellspacing="0" class="GridViewStyleOutside">
            <tr>
                <td>
                    <div class="OperateStyle">
                        <%=Resources.Base.UserID %>
                        :<asp:TextBox ID="txtUserID" runat="server" Width="75px"></asp:TextBox>
                        <%=Resources.Base.EmpID %>
                        <asp:DropDownList ID="ddlEmpID" runat="server" AppendDataBoundItems="True">
                            <asp:ListItem Value="">--</asp:ListItem>
                        </asp:DropDownList>
                        <%-- <asp:Button ID="btnSearch" runat="server" Text="<%$Resources:Base,Search %>" OnClick="btnSearch_Click"
                            CssClass="button_bak" CausesValidation="False" />
                        <asp:Button ID="btnAdd" runat="server" CausesValidation="False" CssClass="button_bak"
                            OnClick="btnAdd_Click" Text="<%$Resources:Base,Add %>" />--%>
                        
                        <cc1:OButton ID="btnSearch" runat="server" ButtonType="OP_SEARCH" Text="<%$Resources:Base,Search %>"
                            OnClick="btnSearch_Click" CausesValidation="false" />
                        <cc1:OButton ID="btnAdd" runat="server" ButtonType="OP_ADD" Text="<%$Resources:Base,Add %>"
                            OnClick="btnAdd_Click" CausesValidation="False" />
                    </div>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <div id="gvUsersDiv" style="z-index: 101; width: 100%;" class="overStyle">
                        <asp:GridView ID="GVUsers" DataKeyNames="RecID" runat="server" AllowPaging="True"
                            AutoGenerateColumns="False" OnRowCancelingEdit="GVUsers_RowCancelingEdit" OnRowEditing="GVUsers_RowEditing"
                            PageSize="20" OnPageIndexChanging="GVUsers_PageIndexChanging" OnRowUpdating="GVUsers_RowUpdating"
                            OnRowCommand="GVUsers_RowCommand" CssClass="UserEditGridViewStyle">
                            <Columns>
                                <asp:TemplateField HeaderText="Content">
                                    <EditItemTemplate>
                                        <table id="Table3" border="0" cellpadding="0" cellspacing="0" style="height: 16px">
                                            <tr>
                                                <td align="left" nowrap="nowrap" width="120" style="height: 16px">
                                                    <asp:Label ID="lblDivID" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, Users.FIELD_DivID) %>'></asp:Label>
                                                </td>
                                                <td align="left" nowrap="nowrap" width="120" style="height: 16px">
                                                    <asp:TextBox ID="txtUserID" Width="115" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, Users.FIELD_UserID) %>'></asp:TextBox>
                                                    <asp:RequiredFieldValidator ID="rvUserID" Display="Dynamic" Enabled="true" ControlToValidate="txtUserID"
                                                        runat="server"> User ID could not be blank</asp:RequiredFieldValidator>
                                                    <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtUserID"
                                                        Display="Dynamic" ErrorMessage="User ID length must between 1 and 20" ValidationExpression=".{1,20}"></asp:RegularExpressionValidator>
                                                </td>
                                                <td align="left" nowrap="nowrap" width="120" style="height: 16px">
                                                    <asp:TextBox ID="txtPassword" Width="115" TextMode="password" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, Users.FIELD_Password) %>'></asp:TextBox>
                                                    <asp:RequiredFieldValidator ID="rvPassword" Display="Dynamic" Enabled="true" ControlToValidate="txtPassword"
                                                        runat="server"> Password could not be blank</asp:RequiredFieldValidator>
                                                </td>
                                                <td align="left" nowrap="nowrap" width="140" style="height: 16px">
                                                    <asp:TextBox ID="txtUserName" Width="135" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, Users.FIELD_UserName) %>'></asp:TextBox>
                                                    <asp:RequiredFieldValidator ID="rvUserName" Display="Dynamic" Enabled="true" ControlToValidate="txtUserName"
                                                        runat="server"> User Name could not be blank</asp:RequiredFieldValidator>
                                                    <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ControlToValidate="txtUserName"
                                                        Display="Dynamic" ErrorMessage="User Name length must between 1 and 50" ValidationExpression=".{1,50}"></asp:RegularExpressionValidator>
                                                </td>
                                                <td align="left" nowrap="nowrap" width="140" style="height: 16px">
                                                    <asp:Label ID="lblEmpID" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, Users.FIELD_EmpID) %>'></asp:Label>
                                                </td>
                                                <td align="left" nowrap="nowrap" width="65" style="height: 16px;">
                                                    <asp:CheckBox ID="chkPause" runat="server" Checked='<%# DataBinder.Eval(Container.DataItem, Users.FIELD_Pause) %>' /></td>
                                            </tr>
                                        </table>
                                        <asp:GridView ID="gvChild" runat="server" AutoGenerateColumns="false" OnRowCommand="gvChild_RowCommand"
                                            AllowPaging="True" OnPageIndexChanging="gvChild_PageIndexChanging" PageSize="10"
                                            CssClass="GridViewStyle">
                                            <Columns>
                                                <asp:BoundField DataField="Name" HeaderText="<%$Resources:Base,Name %>" SortExpression="Name"
                                                    ItemStyle-Width="120px" />
                                                <asp:BoundField DataField="EmpID" HeaderText="<%$Resources:Base,EmpID %>" SortExpression="EmpID"
                                                    ItemStyle-Width="120px" />
                                                <asp:BoundField DataField="DivID" HeaderText="<%$Resources:Base,DivID %>" SortExpression="DivID"
                                                    ItemStyle-Width="120px" />
                                                <asp:TemplateField>
                                                    <ItemTemplate>
                                                        <asp:LinkButton ID="lnkSelect" runat="server" CommandName="Select" CausesValidation="False"
                                                            Text="<%$Resources:Base,Selected %>" CommandArgument="<%# Container.DisplayIndex %>"></asp:LinkButton>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                            </Columns>
                                            <FooterStyle CssClass="GridViewFooterStyle" />
                                            <RowStyle CssClass="UserEditorRowStyle" />
                                            <EditRowStyle CssClass="GridViewEditRowStyle" />
                                            <SelectedRowStyle CssClass="GridViewSelectedRowStyle" />
                                            <PagerStyle CssClass="GridViewPagerStyle" />
                                            <HeaderStyle CssClass="GridViewHeaderStyle" />
                                            <AlternatingRowStyle CssClass="GridViewAlternatingRowStyle" />
                                        </asp:GridView>
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <table id="Table3" border="0" cellpadding="0" cellspacing="0">
                                            <tr>
                                                <td align="left" nowrap="nowrap" width="120" style="height: 25px">
                                                    <%# DataBinder.Eval(Container.DataItem, Users.FIELD_DivID) %>
                                                </td>
                                                <td align="left" nowrap="nowrap" width="120" style="height: 25px">
                                                    <%# DataBinder.Eval(Container.DataItem, Users.FIELD_UserID)%>
                                                </td>
                                                <td align="left" nowrap="nowrap" width="120" style="height: 25px">
                                                    ******</td>
                                                <td align="left" nowrap="nowrap" width="120" style="height: 25px;">
                                                    <span>
                                                        <%# DataBinder.Eval(Container.DataItem, Users.FIELD_UserName)%>
                                                    </span>
                                                </td>
                                                <td align="left" nowrap="nowrap" width="120" style="height: 25px">
                                                    <%# DataBinder.Eval(Container.DataItem, Users.FIELD_EmpID)%>
                                                </td>
                                                <td align="left" nowrap="nowrap" width="65" style="height: 25px;">
                                                    <asp:CheckBox ID="CheckBox2" runat="server" Checked='<%# DataBinder.Eval(Container.DataItem, Users.FIELD_Pause) %>' />
                                                </td>
                                            </tr>
                                        </table>
                                    </ItemTemplate>
                                    <ItemStyle CssClass="UserEditorItemStyle" />
                                    <HeaderTemplate>
                                        <table id="Table5" border="0" cellpadding="0" cellspacing="0" style="height: 30px;">
                                            <tr>
                                                <th align="center" nowrap="nowrap" width="120" style="height: 30px">
                                                    <%=Resources.Base.DivID %>
                                                </th>
                                                <th align="center" nowrap="nowrap" width="120" style="height: 30px">
                                                    <%=Resources.Base.UserID %>
                                                </th>
                                                <th align="center" nowrap="nowrap" width="120" style="height: 30px">
                                                    <%=Resources.Base.UserPWD%>
                                                </th>
                                                <th align="center" nowrap="nowrap" width="140" style="height: 30px">
                                                    <%=Resources.Base.UserName%>
                                                </th>
                                                <th align="center" nowrap="nowrap" width="120" style="height: 30px">
                                                    <%=Resources.Base.EmpID%>
                                                </th>
                                                <th align="center" nowrap="nowrap" width="65" style="height: 30px">
                                                    <%=Resources.Base.Pause%>
                                                </th>
                                            </tr>
                                        </table>
                                    </HeaderTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField>
                                    <EditItemTemplate>
                                        <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Import"
                                            Text="<%$Resources:Base,Import %>" CommandArgument="<%# Container.DisplayIndex %>"></asp:LinkButton>
                                        <asp:LinkButton ID="lnkUpdate" runat="server" CommandName="Update" Text="<%$Resources:Base,Modify %>"></asp:LinkButton>
                                        <asp:LinkButton ID="lnkCancel" runat="server" CausesValidation="False" CommandName="Cancel"
                                            Text="<%$Resources:Base,Cancel %>"></asp:LinkButton>
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Edit"
                                            Text="<%$Resources:Base,Edit %>" CommandArgument="<%# Container.DisplayIndex %>"></asp:LinkButton>
                                    </ItemTemplate>
                                    <ItemStyle Wrap="False" CssClass="UserEditorLinkItemStyle" Width="100px" />
                                </asp:TemplateField>
                            </Columns>
                            <FooterStyle CssClass="GridViewFooterStyle" />
                            <RowStyle CssClass="UserEditorRowStyle" />
                            <EditRowStyle CssClass="GridViewEditRowStyle" />
                            <SelectedRowStyle CssClass="GridViewSelectedRowStyle" />
                            <PagerStyle CssClass="GridViewPagerStyle" />
                            <HeaderStyle CssClass="GridViewHeaderStyle" />
                            <AlternatingRowStyle CssClass="UserEditorAlternatingRowStyle" />
                        </asp:GridView>
                    </div>
                </td>
            </tr>
        </table>
    </div>

    <script type="text/javascript">
//    window.onload=function()
//    {
//        setHeight("gvUsersDiv",-66);
//    }
//    window.onresize=function()
//    {
//        setHeight("gvUsersDiv",-66);
//    }
    </script>

</asp:Content>
